package org.hxyjs.dao.impl;

import org.hxyjs.dao.GameapplyrecordDao;
import org.hxyjs.entity.Gameapplyrecord;
import org.hxyjs.mapper.GameapplyrecordMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository("gameapplyrecordDao")//一般实现类不会直接生成默认对象名 而是使用 接口的默认对象名
public class GameapplyrecordDaoImpl implements GameapplyrecordDao {
    @Resource //autowired 会装配能够直接扫描到的对象  resource spring容器运行的时候才找到需要的对象  注入
    private GameapplyrecordMapper gameapplyrecordMapper;
    public List<Gameapplyrecord>  getAllGameapplyrecords() throws Exception{
        return gameapplyrecordMapper.selectByExample(null);
    }

    @Override
    public Integer deleteGameapplyrecordByGarno(String garno)  throws Exception{
        return gameapplyrecordMapper.deleteByPrimaryKey(garno);
    }

    @Override
    public Integer updateGameapplyrecordByGarno(Gameapplyrecord gameapplyrecord)  throws Exception{
        return gameapplyrecordMapper.updateByPrimaryKey(gameapplyrecord);
    }

    @Override
    public Integer addGameapplyrecord(Gameapplyrecord gameapplyrecord)  throws Exception{
        return gameapplyrecordMapper.insertSelective(gameapplyrecord);
    }

}
